<div class="span9">
    <div class="row-fluid">
        <div class="selection span12">
        
        	<table class="table table-bordered table-striped">
        		<thead>
        			<tr>
        			<th>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
        			<th>&nbsp;</th>
        			</tr>
        		</thead>
        		<tbody>
        			<tr>
        				<th>车辆</th>
        				<td>
                            <select id="select_brand">
                                <option value="<?= $this->url(array('brand'=> null,'model'=>null))?>">不限品牌</option>
	        					<?php foreach ($this->allbrand as $allbrand):?>
									<optgroup label="-- <?= strtoupper($allbrand[s_py])?> --"></optgroup>
										<?php foreach ($allbrand[arr] as $brand):?>
											<option <?php if($i%2 == 0): ?>style="background: #DBDBDB;"<?php endif;?> value="<?= $this->url(array('controller'=>'buy','brand'=> $brand[id]),null,true)?>" <?php if ($this->brand_id == $brand[id]): ?>selected<?php endif;?>><?= strtoupper($allbrand[s_py])."&nbsp;&nbsp;".$brand[brand]?></option>										
										<?php endforeach;?>	
										<?php $i++;?>
								<?php endforeach;?>	
                            </select>
                            <?php if ($this->brand_id):?>
                            <select id="select_model">
                                <option value="<?= $this->url(array('controller'=>'buy','brand'=>$this->brand_id,'model'=> null),null,true)?>">不限车系</option>
                                <?php foreach ($this->putmodel as $company): ?>
                                    <optgroup label="-- <?= $company[company]?> --"></optgroup>
                                    <?php foreach ($company[model] as $model):?>
                                        <option value="<?= $this->url(array('controller'=>'buy','brand'=>$this->brand_id,'model'=> $model[id]),null,true)?>" <?php if ($this->model_id == $model[id]): ?>selected<?php endif;?>><?= $model[model]?></option>
                                    <?php endforeach;?>
                                    
                                <?php endforeach;?>
                            </select>
                            <?php endif;?>
        				</td>
        			</tr>
        			<tr>
        				<th>价格</th>
        				<td>
        				    <?php foreach ($this->putconfig[price] as $price):?>
        					    <a href="<?= $this->url(array('low_price'=>$price[low],'high_price'=>$price[high],'page'=>'1'))?>" <?php if (($price[low] == $this->low_price) && ($price[high] == $this->high_price)):?>class="badge badge-warning"<?php endif;?> data-original-title="<?= $price[name]?>"><?= $price[name]?></a>
                            <?php endforeach;?>
        				</td>
        			</tr>
        			<tr>
        				<th>车龄</th>
        				<td>
        				   <?php foreach ($this->putconfig[age] as $age):?>
        					    <a href="<?= $this->url(array('low_age'=>$age[low],'high_age'=>$age[high],'page'=>'1'))?>" <?php if (($age[low] == $this->low_age) && ($age[high] == $this->high_age)):?>class="badge badge-warning"<?php endif;?> data-original-title="<?= $age[name]?>"><?= $age[name]?></a>
                            <?php endforeach;?>
        				</td>
        			</tr>
        			<tr>
        				<th>搜索</th>
        				<td>
        					<div class="input-append">
        					<input autocomplete="off" placeholder="请输入关键词" id="query" value="<?= $this->query?>" type="text"  onkeydown="event.keyCode==13 && $('#buy_search').click();" data-provide="typeahead"  data-items="6" />
        					<button class="btn" type="button" id="buy_search"><i class="icon-search"></i></button>
        					<input type="hidden" value="<?= $this->url(array('controller'=>'buy','brand'=> $this->brand_id,'model'=> $this->model_id,'query'=>''),null,true)?>" id="search_url" />
        					</div>
        					
        				</td>
        			</tr>
        			<?php if ($this->selected):?>
        			<tr>
        				<th>已选</th>
        				<td>
        					<?php if($this->selected[brand]):?>
        					<a href="<?= $this->url(array('brand'=>null,'model'=>null))?>" class="badge badge-warning" data-original-title="取消"><?= $this->selected[brand][brand]?> <i class="icon-remove icon-white"></i></a>
        					<?php endif;?>
        					<?php if($this->selected[model]):?>
        					<a href="<?= $this->url(array('model'=>null))?>" class="badge badge-warning" data-original-title="取消"><?= $this->selected[model][model]?> <i class="icon-remove icon-white"></i></a>
        					<?php endif;?>
        					<?php if($this->selected[price]):?>
        					<a href="<?= $this->url(array('low_price'=>null,'high_price'=>null))?>" class="badge badge-warning" data-original-title="取消"><?= $this->selected[price]?> <i class="icon-remove icon-white"></i></a>
        					<?php endif;?>
        					<?php if($this->selected[age]):?>
        					<a href="<?= $this->url(array('low_age'=>null,'high_age'=>null))?>" class="badge badge-warning" data-original-title="取消"><?= $this->selected[age]?> <i class="icon-remove icon-white"></i></a>
        					<?php endif;?>
        					<?php if ($this->query):?>
        					<a href="<?= $this->url(array('query'=>null))?>" class="badge badge-warning" data-original-title="取消"><?= $this->selected[query]?> <i class="icon-remove icon-white"></i></a>
        					<?php endif;?>
        				</td>
        			</tr>
        			<?php endif;?>
        		</tbody>
        	</table>
        
        	<ul class="nav nav-tabs">
                <li <?php if ($this->type == 0):?>class="active"<?php endif;?>><a href="<?= $this->url(array('type'=>0, 'page'=>'1'))?>">全部车源</a></li>
                <li <?php if ($this->type == 1):?>class="active"<?php endif;?>><a href="<?= $this->url(array('type'=>1, 'page'=>'1'))?>">个人车源</a></li>
                <li <?php if ($this->type == 2):?>class="active"<?php endif;?>><a href="<?= $this->url(array('type'=>2, 'page'=>'1'))?>">商家车源</a></li>
            </ul>
            <ul class="nav nav-pills hidden-phone">
                <li <?php if ($this->order == 'default'):?>class="active"<?php endif;?>><a href="<?= $this->url(array('order'=>'default', 'page'=>'1'))?>">智能排序<i class="icon-arrow-down"></i></a></li>
                <li <?php if ($this->order == 'new'):?>class="active"<?php endif;?>><a href="<?= $this->url(array('order'=>'new', 'page'=>'1'))?>">最新<i class="icon-arrow-down"></i></a></li>
                <li <?php if ($this->order == 'price'):?>class="active"<?php endif;?>><a href="<?= $this->url(array('order'=>'price', 'page'=>'1'))?>">价格<i class="icon-arrow-up"></i></a></li>
                <li <?php if ($this->order == 'kilometer'):?>class="active"<?php endif;?>><a href="<?= $this->url(array('order'=>'kilometer', 'page'=>'1'))?>">里程<i class="icon-arrow-up"></i></a></li>
                <li <?php if ($this->order == 'age'):?>class="active"<?php endif;?>><a href="<?= $this->url(array('order'=>'age', 'page'=>'1'))?>">车龄<i class="icon-arrow-up"></i></a></li>
            <li class="pull-right">
            <label class="checkbox inline">
				<input type="checkbox" name="is_pic" url_t="<?= $this->url(array('is_pic'=>"1"))?>" url_f="<?= $this->url(array('is_pic'=>"0"))?>" <?php if ($this->is_pic):?>checked<?php endif;?>> 有图
			</label>
			<label class="checkbox inline">
				<input type="checkbox" name="on_sale" url_t="<?= $this->url(array('on_sale'=>"1"))?>" url_f="<?= $this->url(array('on_sale'=>"0"))?>" <?php if ($this->on_sale):?>checked<?php endif;?>> 在售
			</label>
			&nbsp;&nbsp;
            </li>
            </ul>	
            <div class="buy_list">
        	<table class="table table-hover">
        	
            <thead>
                <tr>
                    <th class="hidden-phone"><i class="icon-ok"></i></th>
                    <th class="hidden-phone"></th>
                    <th>详细信息</th>
                    <th class="hidden-phone">价格</th>
                </tr>
            </thead>
            <tbody>
            	<?php if ($this->list[how] == 0):?>
					<tr class="hidden-phone"><td></td><td></td><td><h5 class="text-center"><font color="red">没有您想要的信息,请尝试更改搜车选项,或<a href="<?= $this->url(array('controller'=>'buy','city_id'=>'-1'),null,true)?>">查看其他车源</a><br />下面是淘车乐为您推荐的车源信息</font></h5></td><td></td></tr>
					<tr class="visible-phone"><td><h5 class="text-center"><font color="red">没有您想要的信息,请尝试更改搜车选项,或<a href="<?= $this->url(array('controller'=>'buy','city_id'=>'-1'),null,true)?>">查看其他车源</a><br />下面是淘车乐为您推荐的车源信息</font></h5></tr>
				
				<?php endif;?>

                <?php foreach ($this->list[row] as $k=>$list):?>
                <?php if ($this->list[lowhow] && ($k == $this->list[lowhow])):?>
					<tr class="hidden-phone"><td></td><td></td><td><h5 class="text-center"><font color="red">满足当前条件的车源信息较少,下面是淘车乐为您推荐的车源信息</font></h5></td><td></td></tr>
					<tr class="visible-phone"><td><h5 class="text-center"><font color="red">满足当前条件的车源信息较少,下面是淘车乐为您推荐的车源信息</font></h5></td></tr>
				<?php endif;?>
                <tr id="t_<?= $list[id]?>">
                	<td class="c hidden-phone">
                        <input type="checkbox" id="check_car" name="check_car" value="<?= $list[id]?>" title="选中车源进行对比">
                    </td>
                    <td class="img hidden-phone">
                    	<div class="<?php if ($list[is_app] == 2):?>sale_s_icon<?php endif;?>"></div>
                        <a target="_blank" href="<?= $this->url(array('controller'=>'buy', 'action'=>'view', 'cid'=>"$list[id]"),null,true);?>"><img width="120" height="90" src="/img/noimg_small.gif" data-original="<?= $list[img_dir].$list[session_id].'/'.$list[session_id].str_replace('.', '_small.', $list[car_img])?>"></a>
                    </td>
                    <td class="cxmc">
                        <a target="_blank" href="<?= $this->url(array('controller'=>'buy', 'action'=>'view', 'cid'=>"$list[id]"),null,true);?>"><?= $list[title]?></a>
                        <br />
                        <?= $list[show_note]?>
                        <br />
                        <p class="visible-desktop"><?= $list[color_name]?>/<?= $list[kilometer]?>万公里/<?= $list[car_year]?>年<?= $list[car_month]?>月上牌</p>
                    </td>
                    <td class="price hidden-phone">
                        <b class="p_num"><?= $list[show_price]?></b>万元
                    </td>
                </tr>
                <?php endforeach;?>

            </tbody>
        
        	</table>
        	</div>
        </div>
        
        
        
        <div class="pagination pagination-centered">
        	<ul>
        	    <?php if ($this->list[mulitpage]):?>
        		    <?= $this->list[mulitpage]?>
        		<?php else:?>
        		    <li>&nbsp;</li>
        		<?php endif;?>
        	</ul>
        </div>
        <div class="text-center alert">
        	<i class="icon-search"></i> 淘车乐一下为您找到  <strong><?= $this->list[how]?></strong> 条信息， <a href="<?= $this->url(array('controller'=>'sale', 'action'=>'index'),null,true);?>" target="_blank" data-original-title="免费帮您卖车">马上发布一条<?= $this->putcity?>二手车信息 &raquo;</a>
        </div>
        
        <div class="buy_bottom hidden-phone">
        	<p class="text-right">
				<small>
					<a href="javascript:getBProfit();" data-original-title="">[换一批]</a>
				</small>
			</p>
			<ul class="unstyled inline" id="bprofit_div">

			</ul>	
			<p class="text-right ">
				<small>
				淘车智能推广<a target="_blank" href="<?= $this->url(array('controller'=>'set','action'=>'profit'),null,true)?>" data-original-title="">[我要推广]</a>
				</small>
			</p>
        </div>
    </div>
</div>

    <div class="buy_box hide">
        <p>工具栏(已加入 <i id="select_num">0</i> 辆车)<small><a href="javascript:empty_box();">[清空]</a></small><small class="pull-right"><a href="javascript:close_box();" class="icon-minus" >&nbsp;</a></small></p>
        <button class="btn btn-large btn-success" type="button" onclick="javascript:contrast();">对比车源</button>
        <a href="javascript:;" class="btn btn-large btn-warning addfavorites" data="<?= $this->url(array('controller'=>'dialog','action'=>'login','ref'=>$this->ref,'isre'=>1),null,true)?>" <?php if (!$this->member):?>id="showWindow"<?php else:?>id="addFavorites"<?php endif;?>>收藏车源</a>
    </div>

<div class="span3 hidden-phone all_right">
    <!-- div class="profit_top"><p>广告测试 </p></div-->

